import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', {
  state: () => {
    const count = ref(0)
    const doubleCount = computed(() => count.value * 2)
    const username = ref('')
    const password = ref('')
    return { count, doubleCount, username, password }
  },
  getters:{
    getUsername: (state) =>{
      return state.username+'hello';
    }
  },
  actions: {
    increment() {
      this.count++
    }
  }

}

)
